package org.system.core.mapper.system;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.system.core.domain.entity.SysUser;

import java.util.List;

/**
* @author baoRoot
* @description 针对表【sys_user(用户信息表)】的数据库操作Mapper
* @createDate 2024-11-05 14:17:49
* @Entity org.system.core.domain.entity.SysUser
*/
@Mapper
public interface SysUserMapper {

    int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar);

    /**
     * 通过用户名查询用户
     *
     * @param userName 用户名
     * @return SysUser
     */
    SysUser selectUserByUserName(String userName);

    /**
     * 查询用户名唯一性
     * @param userName 用户名
     * @return SysUser
     */
    SysUser checkUserNameUnique(String userName);

    int resetPassword(@Param("userName") String userName, @Param("password") String password);

    /**
     * 新增用户
     * @param user 用户
     * @return int
     */
    int insertUser(SysUser user);

    List<SysUser> selectUserList(SysUser sysUser);

    SysUser selectUserById(Long userId);

    SysUser checkPhoneUnique(String phonenumber);

    SysUser checkEmailUnique(String email);

    int updateUser(SysUser user);

    int deleteUserByIds(Long[] userIds);

    List<SysUser> selectAllocatedList(SysUser user);

    List<SysUser> selectUnallocatedList(SysUser user);
}




